
//主页面
require(['./config'],()=>{
    require(['jquery'],()=>{
        $('header').load('/html/header.html',()=>{
          require(['header'],(modA)=>{
            modA()
          })
        })
        $('footer').load('/html/footer.html')
    })
    //轮播图
    require(['swiper'],(Swiper)=>{
        var swiper = new Swiper(".mySwiper", {
            spaceBetween: 30,
            centeredSlides: true,
            autoplay: {
              delay: 2500,
              disableOnInteraction: false,
            },
            pagination: {
              el: ".swiper-pagination",
              clickable: true,
            },
            navigation: {
              nextEl: ".swiper-button-next",
              prevEl: ".swiper-button-prev",
            },
          });
          return swiper
    })
    //渲染商品
    require(['pager'],(modA)=>{
      new modA('.commodity',0,8,'/data/goods.json')
      new modA('.commodity2',24,40,'/data/goods.json')
     })
     require(['jquery'],()=>{
      window.onscroll = ()=>{
        if($(window).scrollTop()>=822){
            $('.nea').addClass('fixed')
        }else{
            $('.nea').removeClass('fixed')
        }
    }
     })
})